package cn.sccdlg.ssm.utils;

import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder;

/**
 * @author RaoShuang
 * @emil 991207823@qq.com
 * @date 2020/10/28 23:15
 * 密码加密工具类
 */
public class BCryptPasswordEncoderUtils {

    private static BCryptPasswordEncoder bCryptPasswordEncoder = new BCryptPasswordEncoder();

    public static String encodePassword(String password) {
        return bCryptPasswordEncoder.encode(password);
    }

    public static void main(String[] args) {
        String password = "111111";
        String pwd = encodePassword(password);
        //$2a$10$V2WhOnCFz/woM.sRLQg4yOMxzWG3YCMxfLRSfEWy3qNUxPfQPoIY6
        //$2a$10$47v0oRO9OmigwFakNh/cK.QUfSD.eIOwolCh3yDT0pydppyRHAtpC
        System.out.println(pwd);
        System.out.println(pwd.length());
    }
}
